package cn.jly.spring.boot.cloud.controller;

import cn.jly.spring.boot.cloud.utils.ResultBase;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lanyangji
 * @description 基础控制器
 * @date 2020/11/23 下午 8:37
 */
@Controller
public class BaseController {

    @ResponseBody
    @GetMapping("/ex")
    public void testExHandle() {
        throw new RuntimeException("测试异常");
    }

    @ResponseBody
    @GetMapping("/test")
    public ResultBase test(String name) {
        return ResultBase.build(200, "hello guys, " + name, null);
    }
}
